package com.jackykeke.opengldemo.function

import android.opengl.GLSurfaceView
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.jackykeke.opengldemo.R
import com.jackykeke.opengldemo.renderer.VertexArrayRenderer

class VaoDrawTriangleActivity : AppCompatActivity() {

    var mGLSurfaceView: GLSurfaceView? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_vao_draw_triangle)

        setupView()
    }

    private fun setupView() {
        mGLSurfaceView = GLSurfaceView(this)
        setContentView(mGLSurfaceView)
        val renderer = VertexArrayRenderer()
        //设置版本
        mGLSurfaceView?.apply {
            setEGLContextClientVersion(3)
            setRenderer(renderer)
        }


    }

}